package S06;
public class Text implements Computable{
	private String text;
	public Text(String text) {
		this.text=text;
	}
	@Override
	public String getResult() {
		try {
			int len1 = text.length();//字符串的总长度
			int ch=text.getBytes("GBK").length-len1;
			int en=len1-ch;
			return String.format("字符串[%s]的总长度为%d，其中中文%d个，英文%d个",text
					, len1, ch, en );
		}catch(Exception e) {
			return null;
		}
	}

}
